package com.niiwoo.civet.trade.dao.mapper.credit;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.niiwoo.civet.trade.dao.criteria.InvestigationPersonCriteria;
import com.niiwoo.civet.trade.dao.entity.credit.CreditInvestigationPerson;
import com.niiwoo.civet.trade.dto.response.credit.InvestigationProjectDTO;

public interface CreditInvestigationPersonMapperExt extends CreditInvestigationPersonMapper {

    /**
     * 根据项目ID查询 尽调人信息
     * @param projectId 项目ID
     * @return
     */
    CreditInvestigationPerson getInvestorsByProjectId(Long projectId);
    
	/**
	 * 根据条件查询信用借尽调列表
	 * 
	 * criteria 条件封装
	 * @return
	 */
	List<CreditInvestigationPerson> selectByCriteria(InvestigationPersonCriteria criteria);

	/**
	 * 根据条件查询尽调项目列表
	 * 
	 * @param criteria 条件封装
	 * @return
	 */
	List<InvestigationProjectDTO> selectInvestigationProjectByCriteria(InvestigationPersonCriteria criteria);
	
	/**
	 * 根据条件统计尽调项目
	 * 
	 * @param criteria
	 * @return
	 */
	Integer countInvestigationProjectByCriteria(InvestigationPersonCriteria criteria);

	/**
	 * 统计用户有效尽调笔数
	 * 
	 * @param investigationUserId 尽调用户ID
	 * @return
	 */
	Integer countEffectiveByUserId(@Param("investigationUserId") String investigationUserId);
	
	/**
	 * 统计用户收益
	 *  
	 * @param investigationUserId 尽调用户ID
	 * @param beginTime @查询开始时间
	 * @return
	 */
	BigDecimal countIncomeAmountByUserId(@Param("investigationUserId") String investigationUserId, @Param("beginTime") String beginTime);
}